﻿using System;
using System.Diagnostics;

namespace ThePresenter.Net.NetCom
{
    /// <summary>
    /// Class used to output debug messages
    /// </summary>
    public class DebugClass
    {
		public static Guid LocalhostDebugGuid;

		private String _Category;
        public static Boolean Enabled = true;

        public DebugClass(String Category)
        {
            this._Category = Category;
        }

        public void Write(String Message, params object[] args)
        {
            if (DebugClass.Enabled) Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss.FFFF") + " " + String.Format(Message, args), this._Category);
        }

        public static void DebugWrite(String Category, String Message, params object[] args)
        {
            if (DebugClass.Enabled) Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss.FFFF") + " " + String.Format(Message, args), Category);
        }

        public static void ShowMessage(string p, params object[] args)
        {
            System.Windows.MessageBox.Show(String.Format(p, args));
        }
    }
}
